package main

import (
    "context"
    dry_user "dry_base/rpc/user"
    "fmt"
    "github.com/gin-gonic/gin"
    "github.com/micro/go-micro/v2/client"
    "github.com/micro/go-micro/v2/web"
)

func Add(c *gin.Context) {
    userService := dry_user.NewUserService("user_service", client.DefaultClient)
    response, _ := userService.Add(context.TODO(), &dry_user.Request{
        A: 10,
        B: 20,
    })
    c.String(200, fmt.Sprint(response.C))
}

func main() {
    r := gin.Default()
    r.GET("/Add", Add)
    service := web.NewService(web.Address(":20001"))
    service.Init()
    service.Handle("/", r)
    service.Run()
}
